package com.code.bolg.mappper;

import com.code.bolg.bean.Item;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class ItemMapper implements RowMapper<Item> {
    @Override
    public Item mapRow(ResultSet resultSet, int i) throws SQLException {
        Item item = new Item();
        item.setId(resultSet.getInt("id"));
        item.setTitle(resultSet.getString("title"));
        item.setUrl(resultSet.getString("url"));
        item.setCreatDate(resultSet.getDate("creat_date"));
        return item;
    }
}
